package com.example.demo.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;

//template目录下的所有页面，只能通过controller来跳转
//这个需要模版引擎的支持
@Controller
public class IndexContrller {
    @RequestMapping("/index")
    public String index(Model module){
        module.addAttribute("msg","hello spring");
        module.addAttribute("users", Arrays.asList("yjh","testdemo"));
        return "index";
    }
}
